﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExpertMIS.Entities;
using ExpertMIS.Brokers;

namespace ExpertMIS.Workships
{
    public partial class PostFAQ : ExpertMIS.Codes.PostPage
    {
        private ExpertEntity GetExpertEntity()
        {
            ADMUserEntity user = CurrentUser as ADMUserEntity;
            if (user.IsExpert == false) return null;

            ExpertBroker expertBroker = new ExpertBroker();
            return expertBroker.GetExpertEntityByUserID(user.OID);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            ucPostQuestion1.SetContentHeight(300);

            ExpertEntity expert = GetExpertEntity();
            ucPostQuestion1.PostFAQ(expert.OID);
        }

        protected override bool CheckFeatureRights()
        {
            return GetExpertEntity() != null;
        }
    }
}
